﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using slimPickins.Tools.PropParser;
using slimPickins.Forms.PropEditor;
using slimPickins.Tools.DownloadManager;
using slimPickins.Tools.Update;

namespace slimPickins
{
    public partial class frmMain : Form
    {
        BuildPropParser j;
        DownloadManager downloads = new DownloadManager();

        const string BUILD_PROP_LOCATION = @"C:\Users\Steven\Downloads\I9000_4.2\system\build.prop";

        public frmMain()
        {
            InitializeComponent();
        }


        private void propEditorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmPropEditor fpe = new frmPropEditor(j.propValues);

            fpe.ShowDialog();
        }

        private void btnDownload_Click(object sender, EventArgs e)
        {
            string description = "";
            string md5 = "0";
            string url = SlimUpdate.UPDATE_XML_LINK;

            downloads.addToQueue(url, description, md5);
        }

        private void btnOpen_Click(object sender, EventArgs e)
        {
            j = new BuildPropParser(BUILD_PROP_LOCATION);

            lblRomVersion.Text = j.getRomName() + " v" + j.getRomVersion();
        }
    }
}
